/**
 * author: 何其沆(pooky)
 * desc: Sales Plan - admin - api
 * date: 2021-11-29
 */
import { get, post } from '@/utils/request.js'
import api from '@/config/index.js'

export default {
  /**
   * 获取年份
   * @returns {Promise | Promise<unknown>}
   */
  getYears() {
    return get(api.API_VERSION + '/Admin/SalesPlan/GetYears', {}, false)
  },
  /**
   * 获取当前人管理Branch信息
   * @returns {Promise | Promise<unknown>}
   */
  getBranch() {
    return get(api.API_VERSION + '/Admin/SalesPlan/GetBranch', {}, false)
  },
  /**
   * 获取当前人管理BU信息
   * @returns {Promise | Promise<unknown>}
   */
  getSalesBu() {
    return get(api.API_VERSION + '/Admin/SalesPlan/GetSalesBU', {}, false)
  },
  /**
   * 获取分部或bum年度销售计划
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  getGroupSalesPlan(data) {
    return get(api.API_VERSION + '/Admin/SalesPlan/GetGroupSalesPlan', data, false)
  },
  /**
   * 设置集团销售计划
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  setGroupPlan(data) {
    return post(api.API_VERSION + '/Admin/SalesPlan/SetGroupPlan', data, false)
  },
  /**
   * 获取分部年度销售计划
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  getBranchSalesPlan(data) {
    return get(api.API_VERSION + '/Admin/SalesPlan/GetBranchSalesPlan', data, false)
  },
  /**
   * 设置分部人员销售计划
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  setBranchSalesPlanEmp(data) {
    return post(api.API_VERSION + '/Admin/SalesPlan/SetBranchSalesPlanEmp', data, false)
  },
  /**
   * 设置分部人员月度销售计划
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  setMonthlySalesPlanEmp(data) {
    return post(api.API_VERSION + '/Admin/SalesPlan/SetMonthlySalesPlanEmp', data, false)
  },
  /**
   * 获取BU人员年度销售计划
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  getBUSalesPlan(data) {
    return get(api.API_VERSION + '/Admin/SalesPlan/GetBUSalesPlan', data, false)
  },
  /**
   * 设置分部人员销售计划
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  setBUSalesPlanEmp(data) {
    return post(api.API_VERSION + '/Admin/SalesPlan/SetBUSalesPlanEmp', data, false)
  },
  /**
   * 获取销售人员衡量标准
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  getSalesMeasureStandard(data) {
    return get(api.API_VERSION + '/Admin/SalesPlan/GetSalesMeasureStandard', data, false)
  },
  /**
   * 设置销售人员衡量标准
   * @param data
   * @returns {Promise<unknown>}
   */
  setSalesMeasureStandard(data) {
    return post(api.API_VERSION + '/Admin/SalesPlan/SetSalesMeasureStandard', data, false)
  },
  /**
   * 获取销售人员同时最大客户量
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  getMaxOfTargetList(data) {
    return get(api.API_VERSION + '/Admin/SalesPlan/GetMaxOfTargetList', data, false)
  },
  /**
   * 设置销售人员同时最大客户量
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  setMaxOfTarget(data) {
    return post(api.API_VERSION + '/Admin/SalesPlan/SetMaxOfTarget', data, false)
  },
  /**
   * 获取BU下每个人员的Weekly Task
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  getSalesMeasureStandardById(data) {
    return get(api.API_VERSION + '/Admin/SalesPlan/GetSalesMeasureStandardByEmpID', data, false)
  }
}
